$(function () {
$('#add-newhotel').click(function () {
    window.location.href="./easytrip-producthotel-add.html"
})
//    分页功能
    //完整功能
   /* layui.use(['laypage', 'layer'], function(){
        var laypage = layui.laypage
            ,layer = layui.layer;
        laypage.render({
            elem: 'calendar-paging'
            ,count: 1000
            ,theme: '#45A2FF'
            ,groups:4
            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
            ,jump: function(obj){
                console.log(obj)
            }
        });
    });*/
//    表格js效果
    layui.use(['laypage', 'table'], function(){
        var table = layui.table
            ,laypage = layui.laypage;

        //展示已知数据
        table.render({
            elem: '#demo'
            ,data: [ {
                "id": "00000000023"
                ,"username": "长沙保利瑜璟阁国际公寓"
                ,"contry": "中国"
                ,"province": "湖南"
                ,"city": "长沙"
                ,"star": "五星/豪华型"
                ,"order": "6666"
                ,"state": "未上架"
                ,"operation":"编辑 房型 删除"
                ,"ip": "192.168.0.8"
                ,"logins": "106"
                ,"joinTime": "2016-10-14"
            },  {
                "id": "00000000023"
                ,"username": "长沙保利瑜璟阁国际公寓"
                ,"contry": "中国"
                ,"province": "湖南"
                ,"city": "长沙"
                ,"star": "五星/豪华型"
                ,"order": "6666"
                ,"state": "未上架"
                ,"operation":"编辑 房型 删除"
                ,"ip": "192.168.0.8"
                ,"logins": "106"
                ,"joinTime": "2016-10-14"
            },  {
                "id": "00000000023"
                ,"username": "长沙保利瑜璟阁国际公寓"
                ,"contry": "中国"
                ,"province": "湖南"
                ,"city": "长沙"
                ,"star": "五星/豪华型"
                ,"order": "6666"
                ,"state": "未上架"
                ,"operation":"编辑 房型 删除"
                ,"ip": "192.168.0.8"
                ,"logins": "106"
                ,"joinTime": "2016-10-14"
            },  {
                "id": "00000000023"
                ,"username": "长沙保利瑜璟阁国际公寓"
                ,"contry": "中国"
                ,"province": "湖南"
                ,"city": "长沙"
                ,"star": "五星/豪华型"
                ,"order": "6666"
                ,"state": "未上架"
                ,"operation":"编辑 房型 删除"
                ,"ip": "192.168.0.8"
                ,"logins": "106"
                ,"joinTime": "2016-10-14"
            },  {
                "id": "00000000023"
                ,"username": "长沙保利瑜璟阁国际公寓"
                ,"contry": "中国"
                ,"province": "湖南"
                ,"city": "长沙"
                ,"star": "五星/豪华型"
                ,"order": "6666"
                ,"state": "未上架"
                ,"operation":"编辑 房型 删除"
                ,"ip": "192.168.0.8"
                ,"logins": "106"
                ,"joinTime": "2016-10-14"
            },  {
                "id": "00000000023"
                ,"username": "长沙保利瑜璟阁国际公寓"
                ,"contry": "中国"
                ,"province": "湖南"
                ,"city": "长沙"
                ,"star": "五星/豪华型"
                ,"order": "6666"
                ,"state": "未上架"
                ,"operation":"编辑 房型 删除"
                ,"ip": "192.168.0.8"
                ,"logins": "106"
                ,"joinTime": "2016-10-14"
            },  {
                "id": "00000000023"
                ,"username": "长沙保利瑜璟阁国际公寓"
                ,"contry": "中国"
                ,"province": "湖南"
                ,"city": "长沙"
                ,"star": "五星/豪华型"
                ,"order": "6666"
                ,"state": "未上架"
                ,"operation":"编辑 房型 删除"
                ,"ip": "192.168.0.8"
                ,"logins": "106"
                ,"joinTime": "2016-10-14"
            }, {
                "id": "00000000023"
                ,"username": "长沙保利瑜璟阁国际公寓"
                ,"contry": "中国"
                ,"province": "湖南"
                ,"city": "长沙"
                ,"star": "五星/豪华型"
                ,"order": "6666"
                ,"state": "未上架"
                ,"operation":"编辑 房型 删除"
                ,"ip": "192.168.0.8"
                ,"logins": "106"
                ,"joinTime": "2016-10-14"
            },
                {
                    "id": "00000000023"
                    ,"username": "长沙保利瑜璟阁国际公寓"
                    ,"contry": "中国"
                    ,"province": "湖南"
                    ,"city": "长沙"
                    ,"star": "五星/豪华型"
                    ,"order": "6666"
                    ,"state": "未上架"
                    ,"operation":"编辑 房型 删除"
                    ,"ip": "192.168.0.8"
                    ,"logins": "106"
                    ,"joinTime": "2016-10-14"
                }, {
                    "id": "00000000023"
                    ,"username": "长沙保利瑜璟阁国际公寓"
                    ,"contry": "中国"
                    ,"province": "湖南"
                    ,"city": "长沙"
                    ,"star": "五星/豪华型"
                    ,"order": "6666"
                    ,"state": "未上架"
                    ,"operation":"编辑 房型 删除"
                    ,"ip": "192.168.0.8"
                    ,"logins": "106"
                    ,"joinTime": "2016-10-14"
                }, {
                    "id": "00000000023"
                    ,"username": "长沙保利瑜璟阁国际公寓"
                    ,"contry": "中国"
                    ,"province": "湖南"
                    ,"city": "长沙"
                    ,"star": "五星/豪华型"
                    ,"order": "6666"
                    ,"state": "未上架"
                    ,"operation":"编辑 房型 删除"
                    ,"ip": "192.168.0.8"
                    ,"logins": "106"
                    ,"joinTime": "2016-10-14"
                }, {
                    "id": "00000000023"
                    ,"username": "长沙保利瑜璟阁国际公寓"
                    ,"contry": "中国"
                    ,"province": "湖南"
                    ,"city": "长沙"
                    ,"star": "五星/豪华型"
                    ,"order": "6666"
                    ,"state": "未上架"
                    ,"operation":"编辑 房型 删除"
                    ,"ip": "192.168.0.8"
                    ,"logins": "106"
                    ,"joinTime": "2016-10-14"
                }, {
                    "id": "00000000023"
                    ,"username": "长沙保利瑜璟阁国际公寓"
                    ,"contry": "中国"
                    ,"province": "湖南"
                    ,"city": "长沙"
                    ,"star": "五星/豪华型"
                    ,"order": "6666"
                    ,"state": "未上架"
                    ,"operation":"编辑 房型 删除"
                    ,"ip": "192.168.0.8"
                    ,"logins": "106"
                    ,"joinTime": "2016-10-14"
                }, {
                    "id": "00000000023"
                    ,"username": "长沙保利瑜璟阁国际公寓"
                    ,"contry": "中国"
                    ,"province": "湖南"
                    ,"city": "长沙"
                    ,"star": "五星/豪华型"
                    ,"order": "6666"
                    ,"state": "未上架"
                    ,"operation":"编辑 房型 删除"
                    ,"ip": "192.168.0.8"
                    ,"logins": "106"
                    ,"joinTime": "2016-10-14"
                }]
            ,height: 1000
            ,cols: [[ //标题栏
                {checkbox: true/*, LAY_CHECKED: true*/} //默认全选
                ,{field: 'id', title: '酒店ID', width: 204}
                ,{field: 'username', title: '酒店名称', width: 300}
                ,{field: 'contry', title: '国家', width: 146}
                ,{field: 'province', title: '省份', width: 146}
                ,{field: 'city', title: '所在城市', width: 160}
                ,{field: 'star', title: '星级', width: 140}
                ,{field: 'order', title: '订单数', width: 140}
                ,{field: 'state', title: '上架状态', width: 140}
                ,{field: 'operation', title: '操作',width:194}
            ]]
            /*,skin: 'row' //表格风格
             /!*,even: true*!/
             ,page: true //是否显示分页
             ,limits: [5, 7, 10]*/
            ,limit: 11 //每页默认显示的数量
           /* ,theme: '#45A2FF'*/
        });
        laypage.render({
            elem: 'producthotel-paging'
            ,count: 1000
            ,page:'true'
            ,theme: '#45A2FF'
            ,prev: '<em><</em>'
            ,next: '<em>></em>'
            ,layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
            ,jump: function(obj){
                console.log(obj)
            }
        });
    });

})